Chris Pollett > Old Classes >
CS152

( Print View )

Student Corner:
  [Grades Sec1]

  [Submit Sec1]

  [Class Sign Up Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HWs and Quizzes:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Mid]  [Final]

                           












CS152 Spring 2009Practice Midterm

To study for the midterm I would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes at least three times. Second and third time try to see how much you can remember from the first time. (3) Go over what you did on the HW sets. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) If you want to study in groups, at this point you are ready to quiz each other. The practice midterm is below. Here are some facts about the actual midterm: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) One problem (less typos) on the actual test will be from the practice test.

  1. Define data abstraction and control abstraction. Give examples of Basic, Structured, and Unit Data abstractions.
  2. Which was the first programming language to have its syntax specified in BNF
  3. Explain how to compile using gcc the file fred.c (a) into assembly, (b) so that is can be with gdb, (c) into object code.
  4. Give regular expressions for each of the following: (a) C style comments, (b) a string of digits with at most one decimal point, and (c) a Yacc style $ variable.
  5. Imagine C program files where all the characters other than braces have been eliminated. Given a context free grammar for this language.
  6. Give an example of a situation where a straightforward recursive descent implementation of a CFG might result in a compiler that goes into an infinite loop when parsing. How would you fix this problem?
  7. Briefly explain Yacc's YYSTYPE can be set-up and used in a Yacc grammar.
  8. Give an example program where static scoping and dynamic scoping would yield different results. Then give an example where they would yield the same results.
  9. What is an activation of a function? What might be contained in an acitvation record? Are static variables included in the activation record?
  10. What is assignment by sharing? What is assignment by cloning?